//
//  ViewControllerLifeCycleViewController.m
//  UILbrary
//
//  Created by mac on 16/11/19.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ViewControllerLifeCycleViewController.h"

@interface ViewControllerLifeCycleViewController ()
@property (nonatomic, strong) NSString *perserName;
@property (nonatomic, strong) UILabel *titleLabel;


@end

@implementation ViewControllerLifeCycleViewController

{
    NSString * _ageSting;
    NSString * _priceString;
}
- (instancetype)init{
    if (self = [super init]) {
        NSLog(@"%s",__func__);
//        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
//        [self.view addSubview:label];
//        NSLog(@"%s",__func__);
        
    }
    
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
    _titleLabel.text = @"控制器的生命周期";
    _titleLabel.textColor = [UIColor orangeColor];
    return self;
}


- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    
    
    NSLog(@"%s",__func__);
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
        [self.view addSubview:label];
    }
    return self;
}

- (void)loadView{
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
    view.backgroundColor = [UIColor orangeColor];
    self.view = view;
//    view.bounds = self.view.bounds;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    NSLog(@"%s",__func__);
    _perserName = @"viewController life cycle";
    
    NSLog(@"self.personName = %@",_perserName);
    
    _ageSting = @"binbin";
    _priceString = @"1231232";
    NSLog(@"_ageSting = %@   _priceString = %@",_ageSting, _priceString);
    
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    NSLog(@"%s",__func__);
    NSLog(@"viewWillAppear self.personName = %@",_perserName);
    NSLog(@"_ageSting = %@  _priceString = %@",_ageSting, _priceString);
    
}

- (void)viewWillUnload{
    [super viewWillUnload];
    
}
- (void)viewDidUnload{
    [super viewDidUnload];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
